package com.sy.pojo;

/**
 * @className: Orders
 * @author: Mr.Liu
 * @date: 2025/11/11 16:19
 * @Version: 1.0
 * @description:
 */

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单实体类，与数据库表orders映射
 */
@Tag(name = "订单实体类")
@Data
@TableName("orders")
public class Orders {
    @TableId(type = IdType.AUTO)
    @Schema(description = "订单ID")
    private Integer id;// 订单ID
    @Schema(description = "订单号")
    private String orderNumber;         // 订单号（唯一）
    @Schema(description = "用户ID")
    private Integer userId;             // 用户ID（关联users表）
    @Schema(description = "课程ID")
    private Integer courseId;           // 课程ID（关联courses表）
    @Schema(description = "订单金额")
    private BigDecimal amount;          // 订单金额
    @Schema(description = "支付方式")
    private Integer payMethod;          // 支付方式：1微信，2支付宝
    @Schema(description = "订单状态")
    private Integer status;             // 订单状态：0未支付，1已支付，2已退款
    @Schema(description = "下单时间")
    private LocalDateTime createTime;   // 下单时间
    @Schema(description = "支付时间")
    private LocalDateTime checkoutTime; // 支付时间
    @Schema(description = "退款时间")
    private LocalDateTime refundTime;   // 退款时间
    @Schema(description = "备注")
    private String remark;   // 备注
    @TableField(exist = false)
    private Courses courses; //课程临时属性
}
